package com.ykdl.member.kid.adapters;



import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.ykdl.member.kid.R;
import com.ykdl.member.kid.adapters.FeedAdapter.ViewHolder;
import com.ykdl.member.kid.beans.OptionsBean;


import android.content.Context;
import android.graphics.Color;
import android.text.Html;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.style.ForegroundColorSpan;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.RatingBar;
import android.widget.TextView;

public class PopwindowAdapter extends BaseAdapter {
	private Context mContext;
	private ArrayList<OptionsBean> list ;
	public PopwindowAdapter(Context context,ArrayList<OptionsBean> list){
		mContext=context;
		this.list = list;
	}
	public int getCount() {
		if (list!=null) {
			return list.size();
		}else {
			return 0;
		}
		
	}

	public Object getItem(int position) {
		 return list.get(position);
	}

	public long getItemId(int position) {
		return 0;
	}
	public View getView(int position, View convertView, ViewGroup parent) {
		ViewHolder holder = null;
		if (convertView == null) {
			holder = new ViewHolder();
			convertView = ((LayoutInflater)mContext.getSystemService
					(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.popwindowadapter_xml, null);
			holder.item = (TextView) convertView.findViewById(R.id.item);
			convertView.setTag(holder);
		} else {
			holder = (ViewHolder) convertView.getTag();
		}
		holder.item.setText(list.get(position).getName());
		return convertView;
	}
	class ViewHolder {
		
		TextView item;
	}

}
